﻿using System;
using System.Diagnostics;

namespace Jarvis.Server.Domain
{
    public class TerminateProgramAction : Action
    {

        public virtual String ProcessName { get; set; }

        #region Overrides of Action

        public override void Execute()
        {
            var processes = Process.GetProcessesByName(ProcessName);

            foreach (var process in processes)
            {
                process.Kill();
            }
        }

        #endregion
    }
}
